package com.question_barrier.vo.question;

import com.question_barrier.entity.AnswerState;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
@Data
@ApiModel("题目信息")
public class Question {
    @ApiModelProperty("题目id")
    private String topicId;
    @ApiModelProperty("题目内容")
    private String topicContent;
    @ApiModelProperty("选项")
    private List<String> options = new ArrayList<String>();
    @ApiModelProperty("答案")
    private List<String> answers;

    public Question(QuestionDetail.DataBean dataBean, Answers answers){
        this.topicId = dataBean.getTopic().getId();
        this.topicContent = dataBean.getTopic().getContent();
        for(int i=0;i<dataBean.getOptions().size();i++){
            this.options.add(dataBean.getOptions().get(i).getContent());
        }
        this.answers = answers.getData();
    }

}
